import React from 'react';
import { getBaseCommonProps } from '../../base/util';
import type { IProps } from './interface';
import { Radio, RadioGroup } from '@cscec/udp-ui';

/**
 * 单选框
 * @param props
 * @returns 
 */
export default (props: IProps) => {
    const { outRef } = props;
    const newProps = getBaseCommonProps(props);
    if (newProps.options?.length) {
        return <RadioGroup {...newProps} ref={outRef} />;
    }
    return <Radio {...newProps} ref={outRef} />;
}

